const { resolve } =  require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
// const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const merge = require("webpack-merge")
const CommonConfig = require("./webpack.common")
// tree shaking 去除无用代码
// 必须使用es6模块, 开启productions环境

module.exports = merge(CommonConfig, {
  mode: 'production',
  devtool: 'nosources-source-map',
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      title: 'vue-project',
      favicon:resolve(__dirname, './public/favicon.ico'),
      template: resolve(__dirname, './public/index.html')
    }),
  ]
})